<?php
/**
 * @author gao xiang from livesdrop.com
 * @copyright 2009
 * @uses 执行数据库运作
 */
require_once('config.php');
html_header();
$action = $_GET[action];
 if (in_array($action,array("getuser","singlepost","getdate","getcategory"))){
 	session_start();
 }
 /* 获取用户所有文章 */
 if ($action == 'getuser'){
 	$database->fetch_posts($_GET[userid]);
 }elseif($action == 'singlepost'){
 	$database->fetch_posts('',$_GET[postid]);
 }elseif($action == 'getdate'){
 	$date_result=format_date($_GET[date]); 
 	$database->fetch_posts('','',$date_result[0],$date_result[1]);
}elseif($action == 'getcategory'){
	$database->fetch_posts('','','','',$_GET[categoryid]);
}
else
	echo "ERROR: Get the articles error.";


?>